﻿using UnityEngine;
using System.Collections;
using System.Collections.Generic;

public class PerkSystem : MonoBehaviour {

    UnitStatus m_Status;

	// Use this for initialization
	void Start () {
        m_Status = GetComponent<UnitStatus>();
	}
	
	// Update is called once per frame
	void Update () {
        List<PerkData> ListPerk = m_Status.m_unitData.ListPerk;

        for (int i = 0; i < ListPerk.Count; ++i)
        {
            if (ListPerk[i].m_bLoop)
            {
                switch (ListPerk[i].m_iPerkID)
                {
                    case 0:
                        ListPerk[i].m_bLoop = Perk_Brave();
                        break;

                    case 1:
                        ListPerk[i].m_bLoop = Perk_Coward();
                        break;
                }
            }
        }
	}

    void AddPerk()
    {

    }

   bool Perk_Brave()
    {
        m_Status.m_unitData.iBravePoint = -3;

        return false;
    }

    bool Perk_Coward()
    {
        m_Status.m_unitData.iCowardPoint = 3;

        return false;
    }

    void Perk_Strong()
    {
        
    }

    void PerK_Depressive()
    {

    }

    void PerK_Bipolar()
    {
        //if (m_Status.m_unitData.iCurrentMorale <= m_Status.m_unitData.iMorale)
        //    m_Status.m_unitData.iCurrentMorale -= 1 * Time.deltaTime;
    }
}
